//-----------------------------------------------------------------------
// <copyright file="KeyWordSellService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class KeyWordSellService
    {
        #region KeyWordSell

        public static void CreateKeyWordSell(KeyWordSell keyWordSell)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                keyWordSellDAO.CreateKeyWordSell(keyWordSell);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateKeyWordSellException, ex);
            }
        }        

        public static void UpdateKeyWordSell(KeyWordSell keyWordSell)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                keyWordSellDAO.UpdateKeyWordSell(keyWordSell);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateKeyWordSellException, ex);
            }
        }        

        public static void DeleteKeyWordSell(long keyWordId)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                keyWordSellDAO.DeleteKeyWordSell(keyWordId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteKeyWordSellException, ex);
            }
        }
        
        public static KeyWordSell GetKeyWordSell(long keyWordId)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                return keyWordSellDAO.GetKeyWordSell(keyWordId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordSellException, ex);
            }
        }                

        public static KeyWordSellCollection GetKeyWordSellList(KeyWordSellColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                return keyWordSellDAO.GetKeyWordSellList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordSellListException, ex);
            }
        }        

        public static KeyWordSellCollection GetKeyWordSellList(KeyWordSellColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                return keyWordSellDAO.GetKeyWordSellList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordSellListException, ex);
            }
        }        

	    public static KeyWordSellCollection GetKeyWordSellListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                return keyWordSellDAO.GetKeyWordSellListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordSellListException, ex);
            }
        }        

        public static KeyWordSellCollection GetKeyWordSellListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                KeyWordSellDAO keyWordSellDAO = new KeyWordSellDAO();
                return keyWordSellDAO.GetKeyWordSellListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordSellListException, ex);
            }
        }        

        #endregion
    }
}